/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "DryHopNotes")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DryHopNotes.findAll", query = "SELECT d FROM DryHopNotes d"),
    @NamedQuery(name = "DryHopNotes.findByDryHopNoteID", query = "SELECT d FROM DryHopNotes d WHERE d.dryHopNoteID = :dryHopNoteID"),
    @NamedQuery(name = "DryHopNotes.findByDryHopLbs", query = "SELECT d FROM DryHopNotes d WHERE d.dryHopLbs = :dryHopLbs"),
    @NamedQuery(name = "DryHopNotes.findByDryHopStart", query = "SELECT d FROM DryHopNotes d WHERE d.dryHopStart = :dryHopStart"),
    @NamedQuery(name = "DryHopNotes.findByDryHopStop", query = "SELECT d FROM DryHopNotes d WHERE d.dryHopStop = :dryHopStop")})
public class DryHopNotes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "dryHopNoteID")
    private Integer dryHopNoteID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dryHopLbs")
    private float dryHopLbs;
    @Column(name = "dryHopStart")
    @Temporal(TemporalType.DATE)
    private Date dryHopStart;
    @Column(name = "dryHopStop")
    @Temporal(TemporalType.DATE)
    private Date dryHopStop;
    @JoinColumn(name = "dryHopID", referencedColumnName = "HID", nullable=true)
    @ManyToOne(optional = true)
    private Hops hopID;

    public DryHopNotes() {
    }

    public DryHopNotes(Integer dryHopNoteID) {
        this.dryHopNoteID = dryHopNoteID;
    }

    public DryHopNotes(Integer dryHopNoteID, float dryHopLbs) {
        this.dryHopNoteID = dryHopNoteID;
        this.dryHopLbs = dryHopLbs;
    }

    public Integer getDryHopNoteID() {
        return dryHopNoteID;
    }

    public void setDryHopNoteID(Integer dryHopNoteID) {
        this.dryHopNoteID = dryHopNoteID;
    }

    public float getDryHopLbs() {
        return dryHopLbs;
    }

    public void setDryHopLbs(float dryHopLbs) {
        this.dryHopLbs = dryHopLbs;
    }

    public Date getDryHopStart() {
        return dryHopStart;
    }

    public void setDryHopStart(Date dryHopStart) {
        this.dryHopStart = dryHopStart;
    }

    public Date getDryHopStop() {
        return dryHopStop;
    }

    public void setDryHopStop(Date dryHopStop) {
        this.dryHopStop = dryHopStop;
    }

    public Hops getHopID() {
        return hopID;
    }

    public void setHopID(Hops hopID) {
        this.hopID = hopID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (dryHopNoteID != null ? dryHopNoteID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DryHopNotes)) {
            return false;
        }
        DryHopNotes other = (DryHopNotes) object;
        if ((this.dryHopNoteID == null && other.dryHopNoteID != null) || (this.dryHopNoteID != null && !this.dryHopNoteID.equals(other.dryHopNoteID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.DryHopNotes[ dryHopNoteID=" + dryHopNoteID + " ]";
    }
    
}
